﻿<local:DocumentBase x:Class="WPFExcelReport.AB45"           
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    Height="700" Width="1024" 
                    Background="White"
                    Loaded="Window_Loaded"
                    Title="浆纱单"  
>
    <local:DocumentBase.Resources>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="150*" />
            <RowDefinition Height="200*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"></ColumnDefinition>
            <ColumnDefinition Width="100*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
            <Button Content="查询数据"   Margin="60,0,0,0"  FontSize="18" Name="btnQuery" Width="90" Click="btnQuery_Click"/>
            <Button Content="生成报表"   Margin="60,0,0,0"  FontSize="18" Name="btnPrint" Width="90" Click="btnPrint_Click"/>
            <TextBox FontSize="18"      Width="80"  Name="txtABPAUFKRS" Margin="30,0,0,0" Text="生产单" />
            <TextBox  FontSize="18"     Width="160"   Name="txtABPAUFLFD"   Margin="0,0,0,0"    Text="" />
            <TextBox  FontSize="18"     Width="60" Background="Beige" Name="txtABPAUFPOS"  Margin="0,0,0,0"  Text="" />
        </StackPanel>
        <fd:FilteringDataGrid  Grid.Row="1" 
                               Grid.Column="0"  
                               Grid.RowSpan="2"
                               CanUserReorderColumns="True"  
                               CanUserResizeRows="True"
                               CanUserSortColumns="True"
                               IsFilteringCaseSensitive="False"
                               AutoGenerateColumns="False"   
                               EnableRowVirtualization="True"  
                               RowDetailsVisibilityMode="VisibleWhenSelected"  
                               Height="Auto" HorizontalAlignment="Stretch"
                               Width="Auto" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding Path=PRODUCTIONORDER}" 
                               Margin="0,0,0,0" 
                               x:Name="ABPOSDataGrid" 
                               SelectionChanged="MainDataGrid_SelectionChanged"
                               FontSize="18"
                              >
            <fd:FilteringDataGrid.Columns>
                <DataGridTextColumn Header="生"  
                                   Binding="{Binding Path=ABPAUFKRS}"/>
                <DataGridTextColumn Header="产"    
                                   Binding="{Binding ABPAUFLFD}"/>
                <DataGridTextColumn Header="单" Binding="{Binding ABPAUFPOS}"/>
                <DataGridTextColumn Header="品种" Binding="{Binding ABPART}"/>
                <DataGridTextColumn Header="版本" Binding="{Binding ABPVAR}"/>
                <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE}"/>
                <DataGridTextColumn Header="开始" Binding="{Binding ABPSTARTDAT}"/>
                <DataGridTextColumn Header="交期" Binding="{Binding ABPENDDAT}"/>
                <DataGridTextColumn Header="备注" Binding="{Binding COMMENTS}"/>
            </fd:FilteringDataGrid.Columns>
        </fd:FilteringDataGrid  >
        <StackPanel Grid.Row="1" Grid.Column="1" Grid.RowSpan="2">
            <DataGrid  
                   AutoGenerateColumns="False"  
                   FontSize="18"
                   Height="Auto" HorizontalAlignment="Stretch"
                   Width="Auto" VerticalAlignment="Stretch"
                   ItemsSource="{Binding Path=ABFOLGE}" 
                   Margin="0,0,0,0" 
                   x:Name="listABFOLGE" 
                   >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="步骤" Binding="{Binding ABFAFOLGE}"/>
                    <DataGridTextColumn Header="加工" Binding="{Binding ABFKSTKRS}"/>
                    <DataGridTextColumn Header="中心" Binding="{Binding ABFKST}"/>
                    <DataGridTextColumn Header="设备号" Binding="{Binding ABFLIEFNR}"/>
                    <DataGridTextColumn Header="外发厂" Binding="{Binding LSNAME1}"/>
                    <DataGridTextColumn Header="加工类型" Binding="{Binding ABFAGANG}"/>
                    <DataGridTextColumn Header="开始" Binding="{Binding ABFSOLLSTART}"/>
                    <DataGridTextColumn Header="结束" Binding="{Binding ABFSOLLDAT}"/>
                </DataGrid.Columns>
            </DataGrid  >
            <DataGrid  
                   CanUserReorderColumns="True"  
                   CanUserResizeRows="True" CanUserSortColumns="True"
                   AutoGenerateColumns="False"   
                   EnableRowVirtualization="True"  
                   RowDetailsVisibilityMode="VisibleWhenSelected"  
                   Height="Auto" HorizontalAlignment="Stretch"
                   Width="Auto" VerticalAlignment="Stretch"
                   ItemsSource="{Binding Path=GAAUF}" 
                   Margin="0,0,0,0" 
                   x:Name="listGAAUF" 
                   FontSize="18"
                   IsSynchronizedWithCurrentItem="False" Opacity="10" Visibility="Visible">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="纱线"  Width="80" Binding="{Binding GAART}"/>
                    <DataGridTextColumn Header="版本" Binding="{Binding GAVAR}"/>
                    <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE}"/>
                    <DataGridTextColumn Header="成份" Binding="{Binding Composition}"/>
                    <DataGridTextColumn Header="头份" Binding="{Binding GASPUL}"/>
                    <DataGridTextColumn Header="批次" Binding="{Binding ZUPARTIE}"/>
                    <DataGridTextColumn Header="纺批" Binding="{Binding GPSPPART}"/>
                    <DataGridTextColumn Header="供应商" Binding="{Binding LSNAME1}"/>
                    <DataGridTextColumn Header="需求" Binding="{Binding GAKG1}"/>
                    <DataGridTextColumn Header="留位" Binding="{Binding GAKG3}"/>
                </DataGrid.Columns>
            </DataGrid  >
            <DataGrid  
                AutoGenerateColumns="False"  
                FontSize="18"
                Height="Auto" HorizontalAlignment="Stretch"
                Width="Auto" VerticalAlignment="Stretch"
                ItemsSource="{Binding Path=BABST}" 
                Margin="0,0,0,0" 
                x:Name="listBabst"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="轴" Binding="{Binding BMBAUMKRS}"/>
                    <DataGridTextColumn Header="号码" Binding="{Binding BMBAUMLFD}"/>
                    <DataGridTextColumn Header="类型" Binding="{Binding BMKETTTYP}"/>
                    <DataGridTextColumn Header="长度" Binding="{Binding BMSOLLLG}"/>
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>
        <TextBlock Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Height="Auto" 
                   Background="YellowGreen"
                   HorizontalAlignment="Stretch" Margin="0,0,0,0" 
                   VerticalAlignment="Stretch"
                   TextAlignment="Left"
                   Name="textBlock1" Text="{Binding ElementName=ABPOSDataGrid, Path=SelectedItem.COMMENTS}"/>
    </Grid>
</local:DocumentBase>
